package com.seirsoft.framework.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class DateUtil {
    public static final SimpleDateFormat getDateFormat()
    {
        SimpleDateFormat simpledateformat;
        (simpledateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.S")).setTimeZone(TimeZone.getTimeZone("UTC"));
        return simpledateformat;
    }

    public static String toString(Date date)
    {
        SimpleDateFormat simpledateformat;
        (simpledateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.S'Z'")).setTimeZone(a());
        return simpledateformat.format(date);
    }

    public static String toString(Date date, TimeZone timezone)
    {
        SimpleDateFormat simpledateformat;
        (simpledateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.S z")).setTimeZone(timezone);
        return simpledateformat.format(date);
    }

    public static String toString2(Date date, TimeZone timezone)
    {
        SimpleDateFormat simpledateformat;
        (simpledateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.S")).setTimeZone(timezone);
        return simpledateformat.format(date);
    }
    
    private static TimeZone a()
    {
        return TimeZone.getTimeZone("UTC");
    }
}
